package com.qiyu.mall.user.provider.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.qiyu.mall.user.provider.entity.CommunityAssociatePO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author idea
 * @data 2020/2/11
 */
@Mapper
public interface CommunityAssociateDao extends BaseMapper<CommunityAssociatePO> {

    @Update("UPDATE t_community_associate as tca SET  tca.integral=tca.integral+#{integral} where account_id =#{accountId}")
    Integer updateOneIntegral(@Param( "accountId") int accountId, @Param("integral") Integer integral);

    @Select("select * from t_community_associate")
    List<CommunityAssociatePO> selectAll();
}
